package mdm.com.sap;

import java.util.Iterator;

import com.sap.conn.jco.JCoException;
import com.sap.conn.jco.JCoField;
import com.sap.conn.jco.JCoFunction;
import com.sap.conn.jco.JCoParameterList;
import com.sap.conn.jco.JCoTable;

public class GetPrepareInfo {
    
    //备料
    public static void GetPrepareInfo_CALL(String PRENO) {
        try {
            JCoFunction function = RfcManager.getFunction("ZBAPI_PREORD_GET_PRE_ITEM");
            JCoParameterList importParam = function.getImportParameterList();
            importParam.setValue("PRENO", PRENO);
            function.execute(RfcManager.getDestination());
            Iterator<JCoField> jco=function.getTableParameterList().iterator();
            while(jco.hasNext()) {
                JCoField next=jco.next();
                if(next!=null) {
                    System.out.println("===tables Name===="+next.getName());
                }
            }
            JCoTable ResultTable = function.getTableParameterList().getTable("PRE_ITEM");
            Iterator<JCoField> jco1=ResultTable.iterator();
            while(jco1.hasNext()) {
                JCoField next = jco1.next();
                if(next!=null) {
                    System.out.println("key===="+next.getName());
                }
            }
//            for (int j = 0; j < ResultTable.getNumRows(); j++) {
//                ResultTable.setRow(j);
//                
//            }
        } catch (JCoException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }

}
